import fetch from './util/fetch';

//获取店铺分类
export function getShopCate(merchantId) {
    return fetch({
        url: '/merchant/inner/category/listByMerchantId/' + merchantId,
        method: 'get'
    });
}
//根据四个分类获取分类名
export function getTitleText(data) {
    return fetch({
        url: '/goods/category/categoryNameById',
        method: 'get',
        params: data
    })
}
//根据二级分类获取商品可选的参数
export function getSelectedParams(id) {
    return fetch({
        url: '/goods/parameters/pool/listByTypeId/'+id,
        method: 'get'
    })
}
//根据店铺一级二级分类获取特色项的接口
export function getSpecItem(data) {
    return fetch({
        url: 'goods/characteristic/getlistByCategoryAndType/',
        method: 'get',
        params: data
    })
}
//根据店铺一级二级分类获取保险项的接口
export function getAssure(data) {
    return fetch({
        url: 'goods/insurance/getlistByCategoryAndType/',
        method:'get',
        params:data
    })
}

//普通发布接口
export function postNormalPro(data) {
    return fetch({
        url: '/goods/releaseGoodsInfo',
        method:'post',
        data:data
    })
}

/*
{
    "goods": {
    "id": 19,
        "categoryId": 1,
        "typeId": 1,
        "brandId": 1,
        "modelId": 1,
        "name": "测试发布商品",
        "innerCategoryId": 1,
        "oldLevel": "7",
        "leaseDays": "30,60,90",
        "liquidatedDamagesPermillage": 2,
        "bufferDays": 4,
        "originalPrice": 10000,
        "deposit": 1000,
        "accidentInsurance": 2000,
        "leaseType": "DAILY",
        "buyout": false
},
    "goodsIntroduce": {
    "detail": "说明",
        "imgJson": "[{\"url\":\"xxxx.jpg\"}]"
},
    "goodsParameters": {
    "groups": [
        {
            "id": 60873,
            "name": "基本参数",
            "parametersList": [
                {
                    "id": 61051,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                },
                {
                    "id": 62007,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                },
                {
                    "id": 62575,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                }
            ]
        },
        {
            "id": 62701,
            "name": "基本参数",
            "parametersList": [
                {
                    "id": 63029,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                },
                {
                    "id": 63638,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                },
                {
                    "id": 63911,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                }
            ]
        },
        {
            "id": 64123,
            "name": "基本参数",
            "parametersList": [
                {
                    "id": 64651,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                },
                {
                    "id": 64864,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                },
                {
                    "id": 65354,
                    "parametersPoolId": 1,
                    "parameterValue": "2987"
                }
            ]
        }
    ],
        "deleteGroupList": [
        {
            "id": 65872
        },
        {
            "id": 66473
        },
        {
            "id": 66476
        }
    ],
        "deleteParametersList": [
        {
            "id": 67314
        },
        {
            "id": 68232
        },
        {
            "id": 69042
        }
    ]
},
    "goodsSpecifications": {
    "specificationJson": {
        "specificationFirst": [
            "MS8eAjNnKA",
            "TKcE6QT5Yr",
            "DsYzGTA74B"
        ],
            "specificationSecond": [
            "zBS7pLSZr2",
            "V7doiVVlyG",
            "AlLVJrAmxy"
        ],
            "specificationThird": [
            "rWU9SKzKcu",
            "9o1YSV9xUX",
            "QpQyDmV2fn"
        ],
            "specificationFourth": [
            "7WAedKXRst",
            "eafjmC8yIT",
            "kHoAw16rBg"
        ],
            "specificationFifth": [
            "OP4DnLRpdS",
            "hyMqQUtQlI",
            "0DAToHXS8L"
        ]
    },
    "insertList": [
        {
            "specificationFirst": "大",
            "specificationSecond": "红",
            "specificationThird": "19g",
            "leaseDay": 30,
            "rent": 5000
        },
        {
            "specificationFirst": "大",
            "specificationSecond": "红",
            "specificationThird": "19g",
            "leaseDay": 30,
            "rent": 5000
        },
        {
            "specificationFirst": "大",
            "specificationSecond": "红",
            "specificationThird": "19g",
            "leaseDay": 30,
            "rent": 5000
        }
    ],
        "updateList": [
        {
            "id": 1,
            "specificationFirst": "大",
            "specificationSecond": "红",
            "specificationThird": "19g",
            "leaseDay": 90,
            "rent": 6000
        },
        {
            "id": 1,
            "specificationFirst": "大",
            "specificationSecond": "红",
            "specificationThird": "19g",
            "leaseDay": 90,
            "rent": 6000
        },
        {
            "id": 1,
            "specificationFirst": "大",
            "specificationSecond": "红",
            "specificationThird": "19g",
            "leaseDay": 90,
            "rent": 6000
        }
    ],
        "deleteList": [
        {
            "id": 1
        },
        {
            "id": 1
        },
        {
            "id": 1
        }
    ],
        "goodsId": 1
},
    "insuranceIds": "1,2,3",
    "characteristicIds": "1,2"
}*/
